<?php 
global $_W,$_GPC;
include MODULE_ROOT.'/inc/mobile/__init.php';
//我的订单
$id = intval($_GPC['id']);

$sql = "SELECT * FROM ".tablename('imeepos_runner3_tasks')." WHERE id = :id";
$params = array(':id'=>$id);
$tasks = pdo_fetch($sql,$params);


if($tasks['type'] == 0 || $task['type'] == 1){
	$sql = "SELECT * FROM ".tablename('imeepos_runner3_detail')." WHERE taskid = :taskid";
	$params = array(':taskid'=>$id);
	$detail = pdo_fetch($sql,$params);
}else if($tasks['type'] == 2){
	$sql = "SELECT * FROM ".tablename('imeepos_runner3_buy')." WHERE taskid = :taskid";
	$params = array(':taskid'=>$id);
	$detail = pdo_fetch($sql,$params);
}else{
	message('傻不拉几的，错了吧！');
}

$sql = "SELECT * FROM ".tablename('imeepos_runner3_member')." WHERE uniacid = :uniacid AND openid = :openid";
$params = array(':uniacid'=>$_W['uniacid'],':openid'=>$_W['openid']);
$member = pdo_fetch($sql,$params);

$sql = "SELECT * FROM ".tablename('imeepos_runner3_recive')." WHERE uniacid = :uniacid AND taskid = :taskid";
$params = array(':uniacid'=>$_W['uniacid'],':taskid'=>$id);
$recive = pdo_fetch($sql,$params);

$sql = "SELECT * FROM ".tablename('imeepos_runner3_member')." WHERE uniacid = :uniacid AND openid = :openid";
$params = array(':uniacid'=>$_W['uniacid'],':openid'=>$recive['openid']);
$user = pdo_fetch($sql,$params);



$_pjax = trim($_GPC['_pjax']);

$template_content = $template.'/manage/index';

if($_W['isajax']){
	include $this->template($template_content,TEMPLATE_FETCH);
}else{
	include $this->template($template.'/index');
}